{extend name="../front" /}
{block name="head"}
<title>{$title}－{:config('site.title')}</title>
<meta name="keywords" content="{$keywords}" />
<meta name="description" content="{$description}" />
{/block}
{block name="main"}
<main class="container">
  <div class="card mb-3">
    <div class="card-body">
      <h5 class="card-title fw-bold">{$title}</h5>
      <p class="card-text text-muted">{$description}</p>
      <form class="row g-3 mb-0" action="{:dcUrl('index/dub/save')}" method="post" target="_blank">
        <input type="hidden" name="id" value="{$id}">
        {volist name="fields" id="item"}
        <div class="{$item.class|default='col-12'}">
          <textarea class="form-control fs-0" rows="{$item.rows|default=3}" name="{$key}" id="text-{$item}" placeholder="{$item.tips}" required>{$item.value}</textarea>
        </div>
        {/volist}
        <div class="col-auto">
          <button type="button" class="btn btn-secondary btn-sm btn-trash me-3" data-target=".form-control">清空文案</button>
          <button type="submit" class="btn btn-primary btn-sm">预览文案</button>
        </div>
      </form>
    </div>
  </div>
</main>
{/block}